cmake_minimum_required (VERSION 3.5)
# 工程名
SET(BUILD_PROJECT_NAME "Qslog")

# QT编译必要配置
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Specify MSVC UTF-8 encoding
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

# QT 库文件依赖
find_package(Qt6 COMPONENTS Widgets REQUIRED) # Qt COMPONENTS
find_package(Qt6 COMPONENTS Core REQUIRED) # Qt COMPONENTS
# QT编译必要配置
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
#set(CMAKE_PREFIX_PATH "c:/Qt/6.6.1/mingw_64") # Qt Kit Dir

# 工程编译文件路径
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SRC_LIST)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(${BUILD_PROJECT_NAME} SHARED ${SRC_LIST})

# QT库依赖
target_link_libraries(${BUILD_PROJECT_NAME} PRIVATE Qt6::Core)

INSTALL(TARGETS ${BUILD_PROJECT_NAME}
       RUNTIME DESTINATION ${CMAKE_INSTALL_DIR}
       LIBRARY DESTINATION ${CMAKE_INSTALL_DIR}
       ARCHIVE DESTINATION ${CMAKE_INSTALL_DIR}
)
